package org.zl.mybatis.use.config;

import org.apache.ibatis.plugin.Interceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.zl.mybatis.use.intercept.ExecutorUpdateInterceptor;
import org.zl.mybatis.use.intercept.ParameterHandlerInterceptor;
import org.zl.mybatis.use.intercept.ResultSetHandlerInterceptor;
import org.zl.mybatis.use.intercept.StatementHandlerInterceptor;

/**
 * 
 * @author ben
 * @date 2021-11-30 21:19:50 CST
 */
@Configuration
public class MyBatisConfig {

	/**
	 * 拦截器1
	 * @author ben
	 * @date 2021-11-30 21:20:38 CST
	 * @return
	 */
	@Bean
	public Interceptor executorUpdateInterceptor() {
		return new ExecutorUpdateInterceptor();
	}

	/**
	 * 拦截器2
	 * @author ben
	 * @date 2021-11-30 21:20:45 CST
	 * @return
	 */
	@Bean
	public Interceptor statementHandlerInterceptor() {
		return new StatementHandlerInterceptor();
	}
	
	/**
	 * 拦截器3
	 * @author ben
	 * @date 2021-12-01 20:08:28 CST
	 * @return
	 */
	@Bean
	public Interceptor parameterHandlerInterceptor() {
		return new ParameterHandlerInterceptor();
	}

	/**
	 * 拦截器4
	 * @author ben
	 * @date 2021-12-01 20:08:33 CST
	 * @return
	 */
	@Bean
	public Interceptor resultSetHandlerInterceptor() {
		return new ResultSetHandlerInterceptor();
	}
	
	
}
